﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyBBS.Data.Models
{
    public class Comment
    {
        public long ID { get; set; }
        public string Content { get; set; }
        public long PostID { get; set; }
        public DateTime SubmitTime { get; set; }        
        public string Author { get; set; }

        #region Constrctors

        public Comment() { }

        public Comment(string content, long postID, string author)
        {
            this.Content = content;
            this.PostID = postID;
            this.Author = author;
        }
        #endregion

        #region Override
        public override bool Equals(object obj)
        {
            if (obj is Comment)
            {
                Comment compareTo = (Comment)obj;
                return this.ID == compareTo.ID;
            }
            else
                return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return this.ID.GetHashCode();
        }
        #endregion
    }
}
